R version 4.0.2
ArchRWire version 0.2.01
Vignette for ArchR: https://www.archrproject.com/bookdown/getting-started-with-archr.html
ArchR version 1.0.1
### Load libraries
library(magrittr)
library(ArchR)
library(ggpubr)
library(purrr)
library(devtools)
### Set ArchR parameters.
addArchRThreads(threads = 15) # number of parallel threads
addArchRGenome('hg38') # genome and gene annotation ('hg19', 'hg38', 'mm9', 'mm10')
setwd('/media/ag-rippe/isabelle/ArchRWire_dev')
with_libpaths(new = "/path/to/your/R4.0.2_libs", install('ArchRWire'))
library(ArchRWire, lib.loc = "/path/to/your/R4.0.2_libs")
### Define parameters for analysis
conditions <- c('HUVEC_0min', 'HUVEC_TNFa_30min', 'HUVEC_TNFa_240min', 'HUVEC_TGFb_30min', 'HUVEC_TGFb_240min')
pal <- c('HUVEC_0min' = '#9E9E9E', 'HUVEC_TNFa_30min' = '#03D000', 'HUVEC_TNFa_240min' = '#027A00', 'HUVEC_TGFb_30min' = '#FFA91F', 'HUVEC_TGFb_240min' = '#CC7E00')
### Load ArchRProject
proj <- loadArchRProject('/media/ag-rippe/markus_side_projects/scATAC_HUVEC_TNFa_TGFb/analysis/isabelle/scATAC_10xGenomics/4_archr/ArchRProject_1_basics')
proj # Exemplary ArchRProject contains 5 samples.
proj@reducedDims # 7 iterative LSI reduced dimension objects are present.
proj@embeddings # 7 single-cell UMAP embeddings are present.
options(repr.plot.width=40, repr.plot.height=10)
p <- lapply(conditions, function(sample){plotCellQuality(proj, sample, 3.9)})
ggAlignPlots(plotList=p, type = "h")
umapQC <- plotUmapQC(ArchRProj = proj, # ArchRProj is mandatory
embedding = 'UMAP_25000varFeatures', # specify embedding to use (optional, defaults to first object in ArchRProj's embedding list)
coloringLayer = "Sample", # specify cellColData column to use as comparative coloring layer of single cells (optional, defaults to 'Sample' column)
title = 'QC parameters of single cells', # optional
coloringPalette = pal) # optionally specify colors for reference coloring of single cells
ggpubr::ggarrange(plotlist=umapQC, ncol=3, nrow=2)
umaps <- plotUmaps(proj, # ArchRProj is mandatory
embeddings = names(proj@embeddings[1:3]), # specify embeddings to use (optional, defaults to all objects in ArchRProj's embedding list)
coloringLayer = "Sample", # specify cellColData column to use as comparative coloring layer of single cells (optional, defaults to 'Sample' column)
coloringPalette = pal) # optionally specify colors for coloring of single cells
ggpubr::ggarrange(plotlist=umaps, ncol=3, nrow=1)
umapSplit <- plotUmapSplit(proj, # ArchRProj is mandatory
embedding = 'UMAP_25000varFeatures', # specify embedding to use (optional, defaults to first object in ArchRProj's embedding list)
splitLayer = 'Sample', # specify cellColData column to use as split layer of single cells (optional, defaults to 'Sample' column)
selectLevels = conditions, # specify certain levels of split layer to visualize (optional, defaults to all levels in cellColData 'Sample' column)
coloringPalette = pal) # optionally specify colors for coloring of single cells
ggpubr::ggarrange(plotlist=umapSplit, ncol=3, nrow=2)
umapClusters <- plotUmapClusters(proj, # ArchRProj is mandatory
embedding = 'UMAP_25000varFeatures', # specify embedding to use (optional, defaults to first object in ArchRProj's embedding list)
reducedDims = 'IterativeLSI_25000varFeatures') # specify reduced dimensions to use (optional defaults to first object in ArchRProj's reduced dimensions list)
ggpubr::ggarrange(plotlist=umapClusters, ncol=3, nrow=1)
Visualization with ArchRWire (02.03.2021 | v0.2.01)
i.lander@dkfz-heidelberg.de
Division of Chromatin Networks, DKFZ